/**
 * 张强 on 20170729
 * 年检支付后，用户地址列表：里面地址组件
 */
import React, { Component } from 'react'
import style from './index.scss'
import { Toast,SwipeAction } from 'antd-mobile'
import getAddAddressService from '../../services/addAddressListService';

export default class OrderList extends Component {
	constructor(props) {
		super(props);
		this.state = {
		}
	}

	toUrl(url,data) {
		sessionStorage.setItem('passCache',JSON.stringify(data))
		this.context.router.push(url);
	}

	render() {
		let data = this.props.data;
		console.log('提示语',data)
		let typeText = data.type==1?'往来港澳个人旅游在签注(自由行)':data.type==3?'往来港澳商务再次签注':data.type==4?'往来港澳夫妻探亲再签注':data.type==5?'在深圳非广东户籍':null;
		return (
			<div>
				<div style={{height: '.24rem',background: '#f2f2f2'}}></div>
				<div className={style.orderInformation}>
					<div className={style.orderType} onClick={()=>{this.toUrl('passInformation/noCode',data)}}>
						<span>{/*data.passName*/}{data.bizFullName}</span>
						<img src="./images/icon_right.png" alt=""/>
					</div>
					{
						data.items.map((e,i)=>{
							return 	<div key={i} className={style.price+' '+'cf'}>
								<span>{e.category==1?'香港':e.category==2?'澳门':null}，
									{
										e.times == 1?'三月一次':e.times == 2?'三月二次': e.times == 3?'三月多次':
										e.times == 4?'一年一次': e.times == 5?'一年二次':e.times == 6?'一年多次':null
									}</span>
								<span>￥{e.endorseFee/100}</span>
							</div>
						})
					}

					{
						data.serviceFee?
							<div className={style.price+' '+'cf'}>
								<span>邮政速递服务费用{data.needInvoice==1?'（已申请发票）':''}</span>
								<span>￥{data.serviceFee/100}</span>
							</div>:null
					}

					<div className={style.total+' '+'border_top_1'+' '+'border_bottom_1'}>
						<span>合计</span>
						<span>￥{data.totalFee/100}</span>
					</div>
					<div className={style.address}>
						<div>
							<span>收件人：</span>
							<span>{data.address.contactName}，{data.address.cellNum}</span>
						</div>
						<div>{data.address.fullAddr.replace(null,'')}</div>
					</div>
				</div>
			</div>
		)
	}
}

OrderList.contextTypes = {
	router: React.PropTypes.object.isRequired
};

OrderList.defaultProps = {

};

